#include	"../Api Headers/IMessage.hpp"

_BOF_ZIA_API_

//typedef int api::IConnection;

IMessage::IMessage(api::IConnection & connection) : mConnection(connection)
{
  mHttp = new DataTree;
  mHttpResp = new DataTree;
  //mLog = new ILog;
  mParsed = false;
}

IMessage::~IMessage()
{
}

IMessage::IMessage(const IMessage &r) : mConnection(r.mConnection)
{
  if (this != &r)
    {
      mHttp = r.mHttp;
      mHttpResp = r.mHttpResp;
      //mLog = r.mLog;
      mParsed = r.mParsed;
    }
}

DataTree &	IMessage::http()
{
  return  (*(this->mHttp));
}

DataTree &	IMessage::httpResp()
{
  return (*(this->mHttp));
}

IConnection &	IMessage::connection()
{
  return (this->mConnection);
}

bool		IMessage::isParsed() const
{
  return (this->mParsed);
}

ILog &		IMessage::log()
{
  return (*(this->mLog));
}

IMessage &	IMessage::operator=(const IMessage &r)
{
  if (this != &r)
    {
      mHttp = r.mHttp;
      mHttpResp = r.mHttpResp;
      //mLog = r.mLog;
      mParsed = r.mParsed;
    }
  return (*this);
}

_EOF_ZIA_API_
